<!-- templates/create_video.html -->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>生成教学视频 - 花艺AI测试应用</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
    <style>
        body { padding-top: 2rem; }
        .header { margin-bottom: 2rem; }
        .form-container { max-width: 800px; margin: 0 auto; }
        .example-card { border: 1px solid #ddd; border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
        .example-card img { width: 100%; height: 180px; object-fit: cover; }
        .example-card .card-body { padding: 15px; }
        .feature-icon { font-size: 2rem; color: #6f42c1; margin-bottom: 10px; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header text-center">
            <h1>花艺AI测试应用</h1>
            <p class="lead">生成花艺教学视频</p>
            <nav class="nav justify-content-center">
                <a class="nav-link" href="/">首页</a>
                <a class="nav-link" href="/upload">上传知识</a>
                <a class="nav-link" href="/image">生成图像</a>
                <a class="nav-link" href="/speech">语音交互</a>
                <a class="nav-link" href="/video/list">视频库</a>
                <a class="nav-link" href="/status">系统状态</a>
            </nav>
        </div>

        <div class="row mb-4">
            <div class="col-md-8">
                <div class="card">
                    <div class="card-header bg-purple text-white" style="background-color: #6f42c1;">
                        <h5 class="mb-0">生成花艺教学视频</h5>
                    </div>
                    <div class="card-body">
                        <form action="/video/create" method="post">
                            <div class="mb-3">
                                <label for="topic" class="form-label">教学主题:</label>
                                <input type="text" class="form-control" id="topic" name="topic" required
                                    placeholder="例如: 现代花艺基本技巧、如何搭配玫瑰与满天星、日式插花风格入门">
                            </div>

                            <div class="row mb-3">
                                <div class="col-md-6">
                                    <label for="character_style" class="form-label">角色风格:</label>
                                    <select class="form-select" id="character_style" name="character_style">
                                        <option value="anime">动漫风格</option>
                                        <option value="realistic">写实风格</option>
                                        <option value="painting">绘画风格</option>
                                    </select>
                                </div>
                                <div class="col-md-6">
                                    <label for="style" class="form-label">教学风格:</label>
                                    <select class="form-select" id="style" name="style">
                                        <option value="basic">简洁基础</option>
                                        <option value="detailed" selected>详细专业</option>
                                        <option value="step-by-step">逐步讲解</option>
                                    </select>
                                </div>
                            </div>

                            <div class="row mb-3">
                                <div class="col-md-6">
                                    <label for="duration" class="form-label">视频时长 (秒):</label>
                                    <input type="range" class="form-range" id="duration" name="duration" min="30" max="120" step="10" value="60">
                                    <div class="text-center" id="duration-display">60秒</div>
                                </div>
                                <div class="col-md-6">
                                    <label for="language" class="form-label">语言:</label>
                                    <select class="form-select" id="language" name="language">
                                        <option value="mandarin" selected>普通话</option>
                                        <option value="cantonese">粤语</option>
                                        <option value="english">英语</option>
                                    </select>
                                </div>
                            </div>

                            <div class="mb-3">
                                <label for="voice_id" class="form-label">配音风格 (可选):</label>
                                <select class="form-select" id="voice_id" name="voice_id">
                                    <option value="">默认声音</option>
                                    <option value="xiaoyan">小颜 (女声)</option>
                                    <option value="aisjiuxu">许久 (男声)</option>
                                    <option value="aisxping">小萍 (女声)</option>
                                    <option value="aisjinger">小婧 (女声)</option>
                                </select>
                            </div>

                            <div class="mb-3">
                                <div class="alert alert-info">
                                    <i class="bi bi-info-circle-fill"></i> 视频生成可能需要几分钟时间，请耐心等待。
                                </div>
                            </div>

                            <button type="submit" class="btn btn-primary">
                                <i class="bi bi-camera-video-fill"></i> 开始生成视频
                            </button>
                        </form>
                    </div>
                </div>
            </div>

            <div class="col-md-4">
                <div class="card mb-3">
                    <div class="card-header bg-info text-white">
                        <h5 class="mb-0">使用指南</h5>
                    </div>
                    <div class="card-body">
                        <p><i class="bi bi-1-circle"></i> <strong>选择主题</strong>: 输入您想要创建的花艺教学主题。</p>
                        <p><i class="bi bi-2-circle"></i> <strong>设置风格</strong>: 选择角色和教学风格。</p>
                        <p><i class="bi bi-3-circle"></i> <strong>调整时长</strong>: 选择适合您需求的视频长度。</p>
                        <p><i class="bi bi-4-circle"></i> <strong>等待生成</strong>: 系统会自动生成视频，请耐心等待。</p>
                    </div>
                </div>

                <div class="card">
                    <div class="card-header bg-success text-white">
                        <h5 class="mb-0">主题示例</h5>
                    </div>
                    <div class="card-body">
                        <ul class="list-group">
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                日式池坊花艺技巧
                                <button class="btn btn-sm btn-outline-primary topic-btn" data-topic="日式池坊花艺技巧">
                                    <i class="bi bi-plus-circle"></i>
                                </button>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                玫瑰与绿叶的完美搭配
                                <button class="btn btn-sm btn-outline-primary topic-btn" data-topic="玫瑰与绿叶的完美搭配">
                                    <i class="bi bi-plus-circle"></i>
                                </button>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                春季婚礼花艺布置指南
                                <button class="btn btn-sm btn-outline-primary topic-btn" data-topic="春季婚礼花艺布置指南">
                                    <i class="bi bi-plus-circle"></i>
                                </button>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                如何保持鲜花更持久
                                <button class="btn btn-sm btn-outline-primary topic-btn" data-topic="如何保持鲜花更持久">
                                    <i class="bi bi-plus-circle"></i>
                                </button>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <div class="row mb-4">
            <div class="col-12">
                <h3 class="text-center mb-4">文生视频功能特点</h3>
            </div>
            <div class="col-md-3 text-center">
                <div class="feature-icon">
                    <i class="bi bi-camera-video"></i>
                </div>
                <h5>AI生成文案</h5>
                <p>DeepSeek-R1结合专业知识嵌入模块生成高质量插花教程文案</p>
            </div>
            <div class="col-md-3 text-center">
                <div class="feature-icon">
                    <i class="bi bi-person-bounding-box"></i>
                </div>
                <h5>虚拟花艺师</h5>
                <p>使用StableDiffusion生成虚拟花艺师立绘形象</p>
            </div>
            <div class="col-md-3 text-center">
                <div class="feature-icon">
                    <i class="bi bi-music-note-beamed"></i>
                </div>
                <h5>语音合成</h5>
                <p>采用VITS技术生成逼真的语音，增强视频沉浸感</p>
            </div>
            <div class="col-md-3 text-center">
                <div class="feature-icon">
                    <i class="bi bi-film"></i>
                </div>
                <h5>角色动画</h5>
                <p>LivePortrait技术使角色口型与语音同步，更加生动</p>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 时长滑块显示
            const durationSlider = document.getElementById('duration');
            const durationDisplay = document.getElementById('duration-display');

            durationSlider.addEventListener('input', function() {
                durationDisplay.textContent = this.value + '秒';
            });

            // 主题示例按钮
            const topicButtons = document.querySelectorAll('.topic-btn');
            const topicInput = document.getElementById('topic');

            topicButtons.forEach(button => {
                button.addEventListener('click', function() {
                    const topic = this.getAttribute('data-topic');
                    topicInput.value = topic;
                    topicInput.focus();
                });
            });
        });
    </script>
</body>
</html>